<?php
/**
 * 查询构建器 find() select()
 * ORM get() all()
 */

namespace app\api\model;


class User extends BaseModel
{
    public function address()
    {
        return $this->hasMany('UserAddress', 'user_id', 'id');
    }

    public static function getByOpenID($openid)
    {
        return self::where('openid', '=', $openid)->find();
    }
}